Repository navigation
fix(*): resolve the latest release under windows powershell 5.1 - #863
Conversation
gloryfromca
left a comment
There was a problem hiding this comment.
No blockers; this can merge as far as I am concerned.
Reviewed github/main...HEAD at d57ad789ea28. The release lookup now handles Windows PowerShell 5.1's non-terminating redirect error through the returned response while preserving PowerShell 7's exception-response path. The added Windows CI step exercises the stock shell independently from pwsh, and that installer job passed. The POSIX harness skips do not weaken Linux CI coverage; they prevent Git Bash from producing host-inaccurate results.
I covered the repository rules, the complete diff, relevant callers and history, backward compatibility across both PowerShell families, test-strength changes, and architecture constraints (no domain or layer boundary is affected). Verification: uv run --frozen --python 3.12 pytest tests/test_install_script.py tests/test_cli_onboard_commands.py -q passed with 395 tests; the source-language and large-file check scripts both exited 0.
|
Not a blocker -- the change is right and I am not asking for anything to Severity of this one finding, not a verdict on the pull request. The blocking findings from this pass are review threads on the changed files; GitHub renders those collapsed, as a file name with no text. This PR and #861 each merge cleanly onto the tip, but conflict with each The cause is that you are both editing the same decorator lines from opposite Worth knowing beyond the textual conflict: the shared marker exists precisely so The UTF-8 fix addresses the instance, not the class. I am not asking you to touch the other 790; that is a different change and For what it is worth, the part of this PR I found most valuable is the admission |
gloryfromca
left a comment
There was a problem hiding this comment.
No blockers; this can merge as far as I am concerned.
Reviewed the delta from d57ad789ea28 and rechecked the resulting github/main...HEAD diff. The new PYTHONUTF8=1 configuration covers every CI job that invokes pytest, is inherited by the intended subprocesses, and does not skip or weaken any tests. The Windows installer and self-upgrade jobs pass on this head.
I rechecked the repository rules, affected workflow callers and history, backward compatibility, test integrity, and architecture constraints; this CI-only delta does not cross a domain or layer boundary. Verification: uv run --frozen --python 3.12 pytest tests/test_install_script.py tests/test_cli_onboard_commands.py -q passed with 395 tests, and the source-language gate exited 0.
|
Not a blocker. Round two on Severity of this one finding, not a verdict on the pull request. The blocking findings from this pass are review threads on the changed files; GitHub renders those collapsed, as a file name with no text. Gates on the merged tree (base is an ancestor of head, so head is the merged tree): What I checked and found rightYour "On Linux this is a no-op" is correct, and I verified it rather than taking it: the The class you describe is real and I measured it at this head: 792 Nit 1 -- the measure is in the one place the developer it names never readsYour stated beneficiary is "the next GBK-console developer", and the variable is in The three placements, measured off the parsed workflow:
So nothing it is on can change a decode today, and the only job whose matrix actually Nit 2 -- the in-file comment describes a matrix that does not exist
Smaller, in the same comment: "the stock shell on a GBK-locale Windows machine reads and Stated, not filed
Not coveredThe delta is CI configuration; no runner was exercised. Everything above about what a job |
gloryfromca
left a comment
There was a problem hiding this comment.
No blockers; this can merge as far as I am concerned.
Reviewed the delta from 042a7e58819a and the resulting full diff. Moving UTF-8 mode into the Makefile's pytest targets makes the setting reach the supported local and CI test entry points, while the installer-job setting reaches the Windows installer subprocesses. The changes neither weaken coverage nor alter the PowerShell redirect-resolution paths.
I rechecked the repository rules, workflow and Makefile callers/history, backward compatibility, test integrity, and architecture constraints; no domain or layer boundary is affected. Verification: the focused installer/onboarding suite passed with 395 tests under PYTHONUTF8=1; git diff --check, the source-language gate, and the large-file gate passed. The Windows installer and self-upgrade jobs also pass on this head.
|
Not a blocker. Round three on Severity of this one finding, not a verdict on the pull request. The blocking findings from this pass are review threads on the changed files; GitHub renders those collapsed, as a file name with no text. Both nits closedThe variable is now where the locale can differ. And it now reaches a local run. Dropping it from Gates: Nit -- the one documented way to run the suite is the path that stays exposedThe Makefile comment says it plainly, and it is right: "a bare Not blocking, and not a regression: before this commit there was no local protection at all, Stated, not filed
|
gloryfromca
left a comment
There was a problem hiding this comment.
No blockers; this can merge as far as I am concerned.
Reviewed the delta from 00d914083e05 and rechecked it against the resulting full diff. The conftest guard closes the documented bare uv run pytest gap, fails before locale-dependent test I/O can produce misleading results, and leaves the --noconftest Windows-upgrade path unchanged. It does not affect application runtime or cross an architecture boundary.
I rechecked repository rules, callers and history, backward compatibility, and test integrity. Verification: the focused installer/onboarding suite passed with 395 tests under UTF-8 mode; a forced non-UTF-8 interpreter failed with the intended actionable RuntimeError; the documented python -X utf8 -m pytest remedy restored successful collection of all 47 installer tests. git diff --check, source-language, and large-file gates passed, as did the Windows installer and self-upgrade CI jobs.
LivXue
left a comment
There was a problem hiding this comment.
Code review -- read as request-changes
Ten independent finder angles, two verifier agents, and a gap sweep ran against this PR. Several claims were reproduced empirically on the PR tree. The core fix (-ErrorAction Ignore in Resolve-RavenLatestVersion for PowerShell 5.1) is correct: both old and new code surface identical failure UX on network errors, the 5.1/pwsh shell split is the right mechanism with no simpler unified alternative, and the new live CI step empirically validates the 5.1 behavior on every run.
The substantive findings are in the UTF-8 test-infrastructure half of the PR.
Must fix before merge
-
Makefile:20 --
check-core-wheel(the fourth pytest recipe, part ofmake ci) invokes pytest without thePYTHONUTF8prefix the other three targets got. On a GBK-locale Windows machinemake cipasses lint/test/build, then dies at conftest import incheck-core-wheel. The comment at line 18 also mis-states the situation ("The three pytest targets export it below" -- four pytest recipes exist). A singleexport PYTHONUTF8 := 1covers every recipe line including this one. -
tests/conftest.py:19 -- The UTF-8 gate only accepts
'utf-8'/'utf8'and rejects'cp65001'. A Windows machine with the system-level "Beta: Use Unicode UTF-8 for worldwide language support" option (ACP=65001) is genuinely UTF-8 for all default text I/O (codecs.lookup('cp65001').name == 'utf-8'), butlocale.getpreferredencoding(False)returns'cp65001'and the gate hard-fails everyuv run pytest. -
tests/conftest.py:19 -- Hard-failing the entire suite at conftest import for every non-UTF-8 run path is disproportionate to the one observed failure (a workflow-text scan that already got its root-cause
encoding="utf-8"fix). The ~790 remaining bareread_text()calls behave identically under cp936 and UTF-8 on ASCII content. This converts "developer on GBK Windows runs the suite" from working-minus-one-test into blocked-at-collection for every entry point that misses PYTHONUTF8 (IDE runners, bareuv run pytest, tox). A pre-commit/ruff gate overtests/flaggingread_text()/write_text()/open(withoutencoding=catches new offenders deterministically without refusing working environments.
Should fix
-
tests/test_install_script.py:479 -- Bare
re.search(...).group(1)andstr.indexslicing: a plausible ci.yml refactor (job-leveldefaults: run: shell:, re-indenting, renamingwindows-upgrade) raisesAttributeError/ValueErrorinstead of a readable assertion naming which invariant drifted. -
.github/workflows/ci.yml:292 -- Job-level
PYTHONUTF8: "1"on the installer job means the freshly installedraven --versionsmoke now runs in UTF-8 mode, whereas every real user on a legacy-code-page Windows machine runs it under cp1252/cp936. If raven's--versionpath ever does locale-default text I/O, the gate green-lights a build that fails for exactly the users the PR's docs section addresses. -
tests/test_install_script.py:476 -- The new gate test byte-duplicates the ci.yml read + installer-job slice that the adjacent test already has at lines 460-462 (same
read_text, same" installer:"anchor, same"\n windows-upgrade:"end anchor). Extract a module-level helper.
Nonblocking observations
-
Makefile:20 --
PYTHONUTF8 = 1as a make variable plus per-linePYTHONUTF8=$(PYTHONUTF8)prefixes is indirection for a constant that is never overridden. A singleexport PYTHONUTF8 := 1covers every recipe line (includingcheck-core-wheel, which the per-line prefixing missed). -
.github/workflows/ci.yml:354 -- The new
shell: powershellstep runs a second full install.ps1 sequentially after the identical pwsh step, serially doubling the Windows leg's install wall time. A matrix axis would run both shells in parallel; sharedUV_CACHE_DIRamortizes downloads but not the install/link/verify pass. -
tests/test_install_script.py:480 -- The two-shell gate test pins
UV_TOOL_DIRdistinctness but never pinsUV_TOOL_BIN_DIR(orRAVEN_HOME), although the version probe that makes the gate meaningful is$env:UV_TOOL_BIN_DIR\raven.exe --version. A future edit sharing oneUV_TOOL_BIN_DIRbetween steps makes the ps51 probe answer for the pwsh install while CI stays green. -
.github/workflows/ci.yml:261 -- The trajectory job runs
uv run pytestdirectly with no PYTHONUTF8 anywhere -- the exact bare-invocation exposure the PR's own Makefile comment calls out ("a bareuv run pytestdoes not go through this file and stays exposed"). Benign today (ubuntu-latest, C.UTF-8); one job-levelenv:line closes the asymmetry. -
Commit 00d9140 body -- References internal commit hash
d57ad789and "this branch", which AGENTS.md section 3.3's don't-add list forbids in commit messages ("internal commit-hash references / temporary branch names -- docs/PRs describe the present state only"). Describe the change by its subject instead.
Verified and excluded
- pwsh-7
-ErrorAction Ignoreswallowing network errors: new and old code produce identical failure UX; no functional regression. - Shared
UV_CACHE_DIRbetween sequential steps: uv cache is content-addressed; no lock contention in serial execution. - The conftest gate killing non-pytest tooling entry points: repo-wide grep confirms all
from tests.conftest importhits are pytest-collected test modules, so the guard's blast radius is confined to the suite as intended.
install.ps1 finds the latest release by requesting the release page without following its redirect and reading the Location header off the exception that raises. Only PowerShell 7 raises there. Windows PowerShell 5.1, the shell every Windows ships with, returns the unfollowed redirect as the response and reports the exceeded redirect count as an error with no response attached, so the lookup always came back empty and every one-line install from the stock shell stopped at "Could not resolve the latest Raven release wheel from GitHub". The request now ignores that error and reads the Location header from the response; PowerShell 7 still raises and still goes through the catch. The installer CI job ran install.ps1 under pwsh alone, which is how this went unnoticed. It now also runs the piped install under Windows PowerShell 5.1, into its own tool, bin and home directories. The short URL raven.evermind.ai/install.ps1 answers with a 308, which Windows PowerShell 5.1 does not follow either. The README, the docs site quick start and the release notes template now name the error it prints, (308) Permanent Redirect, and send readers to the direct URL when they see it. Co-authored-by: Claude (claude-opus-5-5) <noreply@anthropic.com>
Three tests failed when the suite ran on a Chinese-locale Windows checkout. CI runs the unit tests on Linux only, so it never saw them. The workflow scan read each file in the locale encoding, GBK there, and stopped on the UTF-8 in release.yml. It now reads UTF-8, as the rest of the file already does. The font and LibreOffice harnesses run install.sh code under sh. On Windows that sh is Git Bash, whose curl sits outside /usr/bin and whose paths mix separators, so two harness tests failed and others passed for the wrong reason: the digest-mismatch test passed because curl was missing, not because of the digest. They now carry the POSIX-only skip the other sh-driven tests already had, shared as one marker. Co-authored-by: Claude (claude-opus-5-5) <noreply@anthropic.com>
Python's locale-dependent text I/O uses the system code page when no explicit encoding= is passed. On a GBK-locale Windows checkout, any test that reads or writes a file containing non-ASCII bytes will fail or silently corrupt data. The class of bug was found in this PR when test_no_workflow_step_enters_the_removed_page_directory stopped on the UTF-8 in release.yml; there are ~790 read_text() call sites without encoding in tests/, and no PYTHONUTF8 anywhere in the test infrastructure, so the next GBK-console developer would hit the next one. Set PYTHONUTF8=1 on every CI job that runs pytest: the unit shard matrix (which also runs the coverage steps), the trajectory regression replay, and the Windows self-upgrade job. On Linux this is a no-op. On Windows it forces every open()/read_text()/write_text() to use UTF-8, making the behaviour identical to what Linux CI already sees. tests/conftest.py is not touched: local developers can set the same variable, or add the flag to their pyproject.toml if needed, but that is a follow-up. Co-authored-by: Claude (claude-opus-5-5) <noreply@anthropic.com>
The variable set by the previous commit sat on jobs whose matrix never carries a Windows runner, so it could not change anything, and the job actually running pytest on Windows -- the installer job -- had none of it. Move it there, with an honest comment. The bot also pointed out that a local `uv run pytest` on a GBK checkout never passes through CI, so a developer on the shell this is all about is exactly as exposed before the commit as after. Export PYTHONUTF8 from the Makefile's three pytest targets instead; the bare `uv run pytest` stays exposed, which is a separate follow-up. The test_cli_onboard_commands.py fix for the encoding-less read_text() in the workflow scan is part of test(*): skip the sh harnesses on windows, which is already in this branch (d57ad78). Co-authored-by: Claude (claude-opus-5-5) <noreply@anthropic.com>
AGENTS.md tells contributors to run 'uv run pytest', and that caller does
not read the Makefile, so the Makefile exports shipped in the previous
commit left the documented local entry point exactly as exposed as
before. tests/conftest.py is the one piece of code every
conftest-loaded run executes; make it stop a non-UTF-8 interpreter at
import with a message naming 'PYTHONUTF8=1' and '-X utf8' as the fix.
The gates still pass on the stock Windows shell: on a GBK-locale
checkout a bare 'uv run pytest' raises RuntimeError ('cp936'), while
any invocation with 'PYTHONUTF8=1' runs the same 45 passed / 13
skipped installer and onboarding tests as before. --noconftest runs
(the windows-upgrade CI job) do not load conftest at all, and that
job's tests name encoding explicitly, so they are unaffected.
Co-authored-by: Claude (claude-opus-5-5) <noreply@anthropic.com>
check-core-wheel runs pytest under tests/conftest.py too, and it was the one pytest recipe without the PYTHONUTF8 prefix, so on a GBK checkout `make ci` passed test-python and then stopped at the conftest guard. One exported assignment reaches every recipe, targets added later included, and the comment no longer counts them. Co-authored-by: Claude (claude-opus-5-5) <noreply@anthropic.com>
With the system-wide UTF-8 option on, Windows reports its code page as cp65001, which is the UTF-8 codec under another name, and the guard compared names, so it refused every run on a machine that already decodes UTF-8. It now compares codecs. The new tests pin the predicate on the names an interpreter reports, and drive the refusal end to end in an ASCII-locale child so that deleting the guard fails a test. Co-authored-by: Claude (claude-opus-5-5) <noreply@anthropic.com>
The installer job runs no tests. After checkout its steps install raven and run it: install.sh or install.ps1 installing the latest release, and the installed raven answering --version. A job-level PYTHONUTF8 changed nothing but how that raven runs, and users on a legacy code page run it without UTF-8 mode, which is the way this gate exists to run it. Both PowerShell installs passed on windows-latest without the variable before it was added here. Co-authored-by: Claude (claude-opus-5-5) <noreply@anthropic.com>
Both CI gate tests read ci.yml and cut the installer job out of it with the same two anchors, so renaming either job meant editing both in step. They now share _installer_job(). Co-authored-by: Claude (claude-opus-5-5) <noreply@anthropic.com>
The version check runs the raven.exe in UV_TOOL_BIN_DIR, yet the gate test pinned only UV_TOOL_DIR as distinct, so two steps sharing a bin or home directory passed it while one install could answer for the other. It now pins all three, as the ci.yml comment above the step promises, and a step missing a setting fails naming the pattern and the step rather than with an AttributeError. Co-authored-by: Claude (claude-opus-5-5) <noreply@anthropic.com>
5743cda to
1b23b6a
Compare
|
Round summary for the review above, by its item numbers. Fixed, each reproduced before the change, one commit per finding:
Declined, with the measurement in each thread:
11: left as is. The squash takes this PR's description as the commit body, so per-commit bodies do not reach main, and that one is not being rewritten. The branch is also rebased onto main now that #861 has merged. The one conflict was in tests/test_install_script.py; the sh-driven tests #861 added (its two Node harness tests and |
gloryfromca
left a comment
There was a problem hiding this comment.
No blockers; this can merge as far as I am concerned.
Reviewed the commits since 5743cdab84de and the full rebased github/main...HEAD diff. The rebase cleanly incorporates #861 without carrying its installer-integrity changes in this PR's diff. The new fixes cover every Make recipe through one exported PYTHONUTF8, accept Windows cp65001 by codec identity, keep the installer smoke representative of real user environments, centralize the workflow slice, improve failed-pattern diagnostics, and pin independent tool, bin, and home directories for both PowerShell installs. The declined items do not leave a concrete failure in the current scope.
I rechecked repository rules, callers and history, PowerShell compatibility, test strength, and architecture constraints; no domain or layer boundary is affected. Verification: the conftest/installer/onboarding suite passed with 410 tests and 4 PowerShell-dependent skips; the core-wheel smoke passed; git diff --check, source-language, and large-file gates passed. The Windows installer, Windows self-upgrade, lint, repository, and other completed CI checks are green on this head.
LivXue
left a comment
There was a problem hiding this comment.
Self-check sweep after the round-1 fixes. No Must fix items; the suite reads clean end to end. Five items remain, ordered by weight. This is a COMMENT review; read the first two as request-changes.
Should fix
- tests/test_install_script.py:747 -- the both-powershells mirror test pins shell name and three directory names, but not the step's
if:guard, RAVEN_MINIMAL / RAVEN_NO_LAUNCH, or the run-body version probe. A dead or half-configured ps51 step keeps the test green while the gate stops exercising 5.1. - .github/workflows/ci.yml:381 -- the windows-upgrade job runs pytest with --noconftest on windows-latest (cp1252), and pyproject.toml
norecursedirs = ['tests/integration', ...]confirms tests/integration is excluded by default. The Makefile comment at lines 16-20 claimstests/conftest.py refuses that run instead-- that claim is false for this lane. Today the file is encoding-insensitive so nothing breaks, but the invariant is silently unenforced on exactly the platform the guard was built for.
Nonblocking
- tests/test_install_script.py:729 -- the same
Get-Content install.ps1 -Raw | Invoke-Expressionstring is pinned twice in one file. The both-powershells comprehension plussorted(...) == ['powershell', 'pwsh']already fails the moment the string disappears from either step. - .github/workflows/ci.yml:342 -- the 4-line comment duplicates the test docstring at tests/test_install_script.py:735-741 nearly verbatim.
- tests/conftest.py:29,35 -- getpreferredencoding(False) is called twice in the guard; naming it once above the
ifremoves the chance a future edit changes only one call site.
Verified clean, not findings
- Makefile line-21
export PYTHONUTF8 := 1is inherited bycheck-core-wheelviauv run; the conftest guard still fires there. - cp65001 ("UTF-8 system code page") passes the guard's
codecs.lookup(name).name == 'utf-8'check correctly; that branch is already handled by commit 8091596 in this PR. - With
loCPATH=zh_CN.GBK + PYTHONUTF8=1the guard'sgetpreferredencoding(False)reports 'utf-8' (Python >= 3.15 deprecates this API and reports UTF-8 mode), so a Windows user who follows the message's own fix is not re-blocked. Verified with an isolated conftest run under GBK: 1 passed. - The pwsh 7 catch path around
Get-RavenLatestReleaseis live: a local pwsh 7.6.5 against a 302-stub server throws into the catch on every ErrorAction; the catch is the only place that reads the Location header. The stale "would regress pwsh 7" scenario from the earlier 07:24 note was wrong.
Happy to push a follow-up commit collapsing the three nits into one commit if that lands easier than three threads.
ZuyiZhou
left a comment
There was a problem hiding this comment.
Approved at 1b23b6a. Read the diff. The install.ps1 change is -ErrorAction Ignore on the release-page request: Windows PowerShell 5.1 then returns the unfollowed redirect and Location is read off the response, while PowerShell 7 still raises into the existing catch, and the Location is matched against the same stable-tag pattern. The Windows installer job at this head ran the new 5.1 step (shell: powershell, own tool, bin and home directories) and it passed, so the fix is exercised under the stock shell on every run. The conftest guard compares codecs, so cp65001 passes, it names PYTHONUTF8=1 in the error, and the Makefile export covers every recipe including check-core-wheel. The POSIX_SH_ONLY marker only skips harness tests on Windows. Not rerun here: the test suites, and install.ps1 on a Windows host. Non-blocking: the open thread on tests/test_install_script.py:747 (the mirror-steps test could also pin the if: guard, RAVEN_MINIMAL / RAVEN_NO_LAUNCH and the version probe); it is still unresolved, so the every-thread-resolved rule keeps the merge button off until it is answered.
Summary
Native Windows installs fail from the shell Windows ships with. Both commands the README gives for Windows break under Windows PowerShell 5.1:
irm https://raven.evermind.ai/install.ps1 | iexstops with(308) Permanent Redirect. PowerShell 5.1 follows 301, 302 and 307 redirects but not 308, which is what that URL answers with. This is the error fix: cannot install Raven in Windows via powershell 5.1 #148 reported; the README already offered the direct URL for it.Resolve-RavenLatestVersionrequests the release page without following the redirect and reads the Location header off the exception that raises. Only PowerShell 7 attaches the response to that exception. PowerShell 5.1 returns the unfollowed redirect as the response and reportsMaximumRedirectExceededas an error with no response, so the lookup always came back empty. This came in with fix(*): resolve the latest release without the github api quota #299 and has been on main since.Changes:
install.ps1: the release-page request uses-ErrorAction Ignoreinstead of-ErrorAction Stop, so PowerShell 5.1 reads Location from the returned response. PowerShell 7 still raises regardless of-ErrorActionand goes through the existing catch. The Location is still matched against the same stable-tag pattern.install.ps1underpwshonly, which is how this shipped. It now also runs the piped install under Windows PowerShell 5.1 (shell: powershell), into its own tool, bin and home directories, sharing the uv cache.(308) Permanent Redirectand to switch to the direct URL when that appears. The short URL's redirect itself is unchanged.-ErrorAction Ignore, catch kept) and for the CI gate (both shells, and separate tool, bin and home directories, since the version check runs theraven.exein the bin directory).Second topic, Windows test hygiene: three tests failed when the suite ran on a Chinese-locale Windows checkout. CI runs the unit tests on Linux only, so it never saw them.
test_no_workflow_step_enters_the_removed_page_directoryread workflows in the locale encoding (GBK there) and stopped on the UTF-8 inrelease.yml. It now reads UTF-8.install.shcode undersh, which on Windows is Git Bash: its curl sits outside/usr/binand paths mix separators, so two failed and others passed for the wrong reason (the digest-mismatch test passed because curl was missing). The ten harness tests now carry the POSIX-only skip the other three sh-driven tests already had, shared as onePOSIX_SH_ONLYmarker. Linux runs are unchanged.#861 merged first, and this branch is rebased onto it. The one conflict was in
tests/test_install_script.py. The sh-driven tests #861 added, its two Node harness tests andtest_a_download_that_cannot_be_hashed_is_not_installed, now carry@POSIX_SH_ONLYlike their neighbours, so the marker stays the one spelling of that skip.Third topic, test infrastructure: Python's locale-dependent text I/O uses the system code page when no
encoding=is passed. On a GBK-locale Windows checkout, any test that reads or writes a file containing non-ASCII bytes will fail or silently corrupt data. The class of bug was found above; there are ~790read_text()call sites withoutencodingintests/. Measured on Linux under a zh_CN.GBK locale, main without UTF-8 mode is not one test short: 87 tests fail only there, across 25 files, andtests/test_rpc_schema_match.py(418 tests) does not collect, mostly onUnicodeDecodeErrorfrom reading UTF-8 files.export PYTHONUTF8 := 1, so every recipe runs in UTF-8 mode,check-core-wheel(part ofmake ci) included.tests/conftest.pyraises at import time on any interpreter whose default text encoding is not the UTF-8 codec, telling the caller to setPYTHONUTF8=1or use-X utf8. It compares codecs rather than names, so Windows with the system-wide UTF-8 option, which reportscp65001, passes.uv run pytest, which AGENTS.md documents and which does not read the Makefile, now stops here on a GBK checkout, as does an IDE runner that does not set the variable. CI's--noconftestself-upgrade job (its tests all nameencodingexplicitly) is unaffected.tests/test_conftest_utf8_guard.pypins the codec comparison and drives the refusal in an ASCII-locale child.PYTHONUTF8in no job. The jobs that loadtests/conftest.pyrun on ubuntu-latest, where the locale is UTF-8 already, and theunitjob gets the variable from the Makefile throughmake coverage-shard. The Windows self-upgrade job runs its one file with--noconftest, and that file names its encodings. The installer job runs no tests at all: its steps are raven installing itself and answering--version, so the variable there would only change how raven runs, and that gate exists to run it the way users do.Type
Verification
Run on Windows 11 (zh-CN) with Windows PowerShell 5.1.26100 and PowerShell 7.6.6, before the rebase onto #861 and the second review round. Every install below was isolated:
UV_TOOL_DIR,UV_TOOL_BIN_DIRandRAVEN_HOMEin a temp directory,RAVEN_MINIMAL=1,RAVEN_NO_LAUNCH=1.irm https://raven.evermind.ai/install.ps1fails with(308) Permanent Redirect;irm https://raw.githubusercontent.com/EverMind-AI/Raven/refs/heads/main/install.ps1 | iexstops atCould not resolve the latest Raven release wheel from GitHub.Invoke-WebRequest https://github.com/EverMind-AI/Raven/releases/latest -MaximumRedirection 0 -UseBasicParsing -ErrorAction Stop: 5.1 throwsInvalidOperationException(MaximumRedirectExceeded) with noResponse; 7.6.6 throwsHttpResponseExceptionwhoseResponse.Headers.Locationis the tag URL. With-ErrorAction Ignore, 5.1 returns the 302 with Location set, and 7.6.6 still throws into the catch.redirect-to: 301, 302 and 307 are followed; 308 is not.Get-Content install.ps1 -Raw | Invoke-Expressionunder 5.1 and under 7.6.6, withuv tool update-shelldisabled in a temp copy of the script to leave the user PATH alone: both resolved v0.2.4, installed raven with everos-memory, design-engine and ppt-engine, andraven.exe --versionprintedRaven v0.2.4.uv run pytest tests/test_install_script.py tests/test_release_plugin_list.py tests/test_constraints_export_contract.pyplus the six installer tests intests/test_cli_onboard_commands.py, on Windows: 48 passed, 13 skipped (before: 55 passed, 3 skipped, 3 failed). The two new tripwires fail against the previousinstall.ps1andci.yml. With the UTF-8 gate added, a bareuv run pytest --co -q tests/test_install_script.pyon the GBK checkout raises RuntimeError namingPYTHONUTF8=1, while the same invocations with the variable set pass (45 passed, 13 skipped).uv run ruff checkanduv run ruff format --checkon both test files pass;tydoes not covertests/, the only Python this changes.PYTHONPATH=. uv run python scripts/check_source_language.py origin/mainexits 0.Run on Linux (Ubuntu 22.04, Python 3.12.13) at this head. A zh_CN.GBK locale compiled into a private
LOCPATHgives a non-UTF-8 interpreter (locale.getpreferredencoding(False)isGBK, UTF-8 mode off).Full suite,
uv run --frozen --python 3.12 --all-extras pytest -q: 7 failed, 27567 passed, 119 skipped. On main the same command gives 7 failed, 27556 passed, 119 skipped with the identical 7 failing IDs, this machine's local baseline (five proxy tests, a root-only permission test and an npm found on PATH), so 0 introduced; the 11 extra passes are this PR's new tests.Main under GBK without UTF-8 mode: 86 failed, 27059 passed, 119 skipped, 11 errors. 87 IDs fail only there, and
tests/test_rpc_schema_match.pydoes not collect. One of the 87, a non-ASCII file name, is specific to Linux, where GBK also becomes the filesystem encoding.This head under GBK: a bare
uv run pytest --co -q tests/test_install_script.pystops at the conftest RuntimeError namingPYTHONUTF8=1.make test-python, which exports it: 7 failed, 27567 passed, 119 skipped, the same 7 IDs as under UTF-8.make check-core-wheel: 1 passed, where with the per-target exports it exited 2 at the guard.The harness tests marked
@POSIX_SH_ONLYrun on Linux in the full suite above.Mutations: with the old name tuple back in the guard's predicate, only the
cp65001case oftests/test_conftest_utf8_guard.pyfails; with the guard deleted, its end-to-end refusal test fails. Giving the 5.1 step pwsh'sUV_TOOL_BIN_DIR, or itsRAVEN_HOME, now fails the CI gate test naming the shared variable, where before it passed.make lint-pythonpasses, and the commit-message, source-language and large-file gates exit 0 overorigin/main..HEAD.Relevant tests pass locally
Relevant lint / type checks pass locally
User-facing docs or screenshots are updated when needed
Risk
User-visible: the one-line Windows install works again from Windows PowerShell 5.1 through the direct URL. The short URL still answers with a 308 there, and the docs now name that error.
install.ps1is served from main, so the fix reaches users on merge, and reverting the squash commit rolls it back the same way. The resolved Location is still matched against the same stable-tag pattern before anything is downloaded. The installer CI job gains one Windows install, which reuses the uv cache.Developer-visible: on a Windows checkout whose code page is not UTF-8, a pytest run that loads
tests/conftest.pywithout UTF-8 mode stops at import with a message namingPYTHONUTF8=1; themaketargets set it, and Linux and macOS runs are unaffected. On Windows the sh-driven harness tests report as skipped: the ten this PR marks andtest_a_download_that_cannot_be_hashed_is_not_installed, beside the five that already skipped there.Related Issues
#148